#include "mystdio.h"
#include <stdio.h>
#include <unistd.h>

#define myfile "test.txt"

int main()
{
    _FILE* fp = _fopen(myfile, "w");

    if(fp == NULL)
    {
        printf("_fopen error\n");
        return 1;
    }

    const char* msg = "hello ssy\n";

    int cnt = 5;
    while(cnt--)
    {
        printf("cnt = %d\n", cnt);
        _fwrite(fp, msg, strlen(msg));
        //sleep(1);
    }

    _fclose(fp);
}
